using System;
using System.Collections.Generic;
using System.Text;

namespace Zsa.Emulation.Memory
{
    /// <summary>
    /// Interface for a memory stream that can be written to and 
    /// wrote from.
    /// </summary>
    public interface IMemoryStream
    {
        /// <summary>
        /// Reads the specified address.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <returns></returns>
        byte Read(ushort address);

        /// <summary>
        /// Reads the specified address.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <returns></returns>
        byte Read(int address);

        /// <summary>
        /// Reads the specified buffer.
        /// </summary>
        /// <param name="buffer">The buffer.</param>
        /// <param name="address">The address.</param>
        /// <param name="count">The count.</param>
        /// <returns></returns>
        void Read(byte[] buffer, int address, int count);

        /// <summary>
        /// Writes the specified buffer.
        /// </summary>
        /// <param name="buffer">The buffer.</param>
        /// <param name="address">The address.</param>
        /// <param name="count">The count.</param>
        /// <returns></returns>
        void Write(byte[] buffer, int address, int count);

        /// <summary>
        /// Writes the specified address.
        /// </summary>
        /// <param name="address">The address.</param>
        /// <param name="romByte">The rom byte.</param>
        void Write(int address, byte romByte);

        /// <summary>
        /// Gets the length of the stream.
        /// </summary>
        /// <value>The size.</value>
        int Length { get; }

    }
}
